import 'es6-promise/auto'
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Element from 'element-ui'
import VueLazyLoad from 'vue-lazyload'

import App from './App.vue'

import store from './store'
import router from './router'
import 'normalize.css/normalize.css'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss'
import './router/router.hook'
import './icons'

import * as filters from '@/utils/filters'

Vue.use(VueAxios, axios)
Vue.use(Element, {
  size: 'large' // set element-ui default size
})

Vue.use(VueLazyLoad, {
  preLoad: 1.3,
  error: 'data:img/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEXs7Oxc9QatAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==',
  loading: 'data:img/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEXs7Oxc9QatAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==',
  // error: require('./assets/error.png'),
  // loading: require('./assets/loading.gif'),
  attempt: 1
})

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')
